<?php
/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Gmap
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */

class Gmap_Plugin_Menus
{

  public function canCreateGmaps()
  {
    // Must be logged in
    $viewer = Engine_Api::_()->user()->getViewer();
    if( !$viewer || !$viewer->getIdentity() ) {
      return false;
    }

    // Must be able to create gmaps
    if( !Engine_Api::_()->authorization()->isAllowed('gmap', $viewer, 'create') ) {
      return false;
    }

    return true;
  }

  public function canViewGmaps()
  {
    $viewer = Engine_Api::_()->user()->getViewer();
    
    // Must be able to view gmaps
    if( !Engine_Api::_()->authorization()->isAllowed('gmap', $viewer, 'view') ) {
      return false;
    }

    return true;
  }  

  
}